import { useTranslation } from "react-i18next";
function Home() {
  
  const { t, i18n } = useTranslation();
  // console.log(t);
  
  const changeLanguage = (lang:string) => {
    i18n.changeLanguage(lang);
  };
  return (
    <div>
      <h1>{t("welcome")}</h1>
      <p>{t("greet", { name: "Alice" })}</p>
      <button onClick={() => changeLanguage("en")}>English</button>
      <button onClick={() => changeLanguage("zh")}>中文</button>
    </div>
  );
}

export default Home;
